[Telemetry] Add machine_category metric for hardware classification (CPU/GPU/TPU) - #6010
Conversation
Change-Id: I7eb7dff27edbb553b8df0c3b8d99c0b623577a0f
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the telemetry capabilities of the toolkit by adding a machine category classification feature. By identifying the underlying hardware type of instantiated compute nodes, this change provides better visibility into the infrastructure footprint of deployments. The implementation integrates seamlessly with existing telemetry flows and ensures consistency through robust parsing logic and thorough test coverage. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new telemetry metric, CLUSTER_TOOLKIT_MACHINE_CATEGORY, which maps blueprint machine types to their inferred hardware categories (CPU, GPU, TPU, or Other). This is implemented via the getMachineCategory and detectMachineCategory functions, along with corresponding unit tests. The reviewer suggested an improvement to detectMachineCategory to ensure memory-optimized machine types (e.g., containing -megamem- or -ultramem-) are correctly classified as CPU instead of falling back to Other.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini summary |
Summary of ChangesThis pull request enhances the telemetry infrastructure by adding a machine category classification feature. By dynamically identifying the underlying hardware of compute instances, the toolkit now provides better visibility into the infrastructure footprint of deployments. The implementation ensures consistency with existing telemetry flows and includes robust fallback logic to handle various machine families. Highlights
Activity
|
| } | ||
|
|
||
| // getMachineCategory maps each machine type to its inferred hardware category (CPU/GPU/TPU/Other) | ||
| func getMachineCategory(bp config.Blueprint) string { |
There was a problem hiding this comment.
Is there a way we can reuse the getMachineType function here? The current getMachineCategory function will probably get simpler if we use getMachineType.
442e026 to
035debb
Compare
035debb to
4d3c7a8
Compare
Overview
This PR introduces a new telemetry metric
machine_categoryto categorize instantiated compute machines dynamically by identifying their underlying hardware components (e.g., CPU, GPU, TPU). The metric outputs the detected categories similarly to existing telemetry structures maintaining consistency with execution flows. For example, the output traces configurations likea3-highgpu-8g:GPU,tpu7x-standard-4t:TPU,c2-standard-4:CPU.Here is a section you can append directly to your PR description summarizing the categorization logic clearly for reviewers:
Categorization Logic
The telemetry extraction (
detectMachineCategory) identifies the hardware bucket of an instance via a strict, prioritized sequence to handle ambiguous instance shaping (such as-standard-suffixes shared across CPU and GPU families):IsTPU()identifier, correctly capturingct*,tpu, andv*pod slice shorthands directly.config.GetMachineMappings().MachineFamilyToLabelMap. Ambiguous GPU nodes likeg2-standardorrtx-6000(via shorthand substitution) natively map to"nvidia"payload labels and are flagged correctly asGPU."gpu"implicitly (likea2-highgpu-1g).config.GetMachineMappings().CpuMachineFamilies(e.g.n1-,c2-).-standard-,-highmem-,-highcpu-,custom-). This operates purely as a fallback to guarantee that completely undocumented new CPU families securely classify asCPUrather thanOtheruntil mappings update.Changes